home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / File / c / IsDir < prev    next >
Text File  |  1995-07-08  |  1KB  |  33 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    File.IsDir.c
  12.     Author:  Copyright © 1994 Tim Browse
  13.     Version: 1.01 (03 Jun 1995)
  14.     Purpose: Checks to see if the given file is a directory.
  15.     Mods:    Returns TRUE for images as well as directories.
  16. */
  17.  
  18. #include "DeskLib:Core.h"
  19. #include "DeskLib:File.h"
  20. #include "DeskLib:SWI.h"
  21.  
  22. extern BOOL File_IsDirectory(char *pathname)
  23. {
  24.   unsigned type;
  25.   
  26.   /* Get the file information */
  27.   
  28.   SWI(2, 1, SWI_OS_File, 17, pathname, &type);
  29.   
  30.   return ( (type & 2) ? TRUE : FALSE); /* 2 => directory found, 3 => image */
  31. }
  32.  
  33.